<?php
class Log_Model_Message extends Zen_List {
	public function __construct() {
		$this->table = new Zend_Db_Table('log_message');
	}
	
	public function getInfoByResource($resource) {
		$table = $this->table;
		$data = $table
					->select()
					->from(($table),array('id','username','timestamp','message'))
					->where("resource=?",$resource)
					->where("year(`timestamp`)=?",date('Y'))
					->group('id')
					->order('timestamp desc')
					->limit(1)
					->query()
					->fetch();
		return $data;
	}
}